From: Jan Beulich Date: Fri, 1 Jul 2011 19:43:02 +0000 (+0100) Subject: x86: adjust pirq_spin_lock_irq_desc() X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10083 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=9e71918d4f039e5e4806493bd3310c8ceecedd08;p=xen.git x86: adjust pirq_spin_lock_irq_desc() Remove unnecessary/bogus assertions and add retry loop matching domain_spin_lock_irq_desc(). Signed-off-by: Jan Beulich --- diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index f3cb34a7ee..b46fa9b8cb 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -968,30 +968,31 @@ struct irq_desc *domain_spin_lock_irq_desc( } /* - * Same with struct pirq already looked up, and d->event_lock already - * held (thus the PIRQ <-> IRQ mapping can't change under our feet). + * Same with struct pirq already looked up. */ struct irq_desc *pirq_spin_lock_irq_desc( struct domain *d, const struct pirq *pirq, unsigned long *pflags) { - int irq = pirq->arch.irq; struct irq_desc *desc; unsigned long flags; - ASSERT(spin_is_locked(&d->event_lock)); + for ( ; ; ) + { + int irq = pirq->arch.irq; - if ( irq <= 0 ) - return NULL; + if ( irq <= 0 ) + return NULL; - desc = irq_to_desc(irq); - spin_lock_irqsave(&desc->lock, flags); + desc = irq_to_desc(irq); + spin_lock_irqsave(&desc->lock, flags); + if ( irq == pirq->arch.irq ) + break; + spin_unlock_irqrestore(&desc->lock, flags); + } if ( pflags ) *pflags = flags; - ASSERT(pirq == pirq_info(d, domain_irq_to_pirq(d, irq))); - ASSERT(irq == pirq->arch.irq); - return desc; }